import { mqttDataDetail } from './mqttDataDetail';

export class mqttData {
  constructor(areaCode: string, deviceId?: string) {
    this.areaCode = areaCode;
    if (deviceId)
      this.deviceId = deviceId;
    this.time = new Date().getTime();
  }

  time: number;
  deviceId: string;
  areaCode: string;
  data: mqttDataDetail;

  toString() {
    return JSON.stringify(this);
  }
}